package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.RentalNotificationsMapper;
import com.hello.system.domain.RentalNotifications;
import com.hello.system.service.IRentalNotificationsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 消息通知Service业务层处理
 * 
 * @author hello
 * @date 2025-07-20
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class RentalNotificationsServiceImpl extends ServiceImpl<RentalNotificationsMapper, RentalNotifications> implements IRentalNotificationsService 
{
    private final RentalNotificationsMapper rentalNotificationsMapper;

    /**
     * 查询消息通知
     * 
     * @param notificationId 消息通知主键
     * @return 消息通知
     */
    @Override
    public RentalNotifications selectRentalNotificationsByNotificationId(Long notificationId)
    {
        return rentalNotificationsMapper.selectRentalNotificationsByNotificationId(notificationId);
    }

    /**
     * 查询消息通知列表
     * 
     * @param rentalNotifications 消息通知
     * @return 消息通知
     */
    @Override
    public List<RentalNotifications> selectRentalNotificationsList(RentalNotifications rentalNotifications)
    {
        return rentalNotificationsMapper.selectRentalNotificationsList(rentalNotifications);
    }

    /**
     * 新增消息通知
     * 
     * @param rentalNotifications 消息通知
     * @return 结果
     */
    @Override
    public int insertRentalNotifications(RentalNotifications rentalNotifications)
    {
        rentalNotifications.setCreateTime(DateUtils.getNowDate());
        return rentalNotificationsMapper.insertRentalNotifications(rentalNotifications);
    }

    /**
     * 修改消息通知
     * 
     * @param rentalNotifications 消息通知
     * @return 结果
     */
    @Override
    public int updateRentalNotifications(RentalNotifications rentalNotifications)
    {
        rentalNotifications.setUpdateTime(DateUtils.getNowDate());
        return rentalNotificationsMapper.updateRentalNotifications(rentalNotifications);
    }


    /**
     * 批量删除消息通知
     * 
     * @param notificationIds 需要删除的消息通知主键
     * @return 结果
     */
    @Override
    public int deleteRentalNotificationsByNotificationIds(Long[] notificationIds)
    {
        return rentalNotificationsMapper.deleteRentalNotificationsByNotificationIds(notificationIds);
    }

    /**
     * 删除消息通知信息
     * 
     * @param notificationId 消息通知主键
     * @return 结果
     */
    @Override
    public int deleteRentalNotificationsByNotificationId(Long notificationId)
    {
        return rentalNotificationsMapper.deleteRentalNotificationsByNotificationId(notificationId);
    }
}
